domain-specific compiler
Optimizing FDTD Solvers for Electromagnetics: A Compiler-Guided Approach with High-Level Tensor Abstractions
He, Yifei, Andersson, Måns I., Markidis, Stefano
The Finite Difference Time Domain (FDTD) method is a widely used numerical technique for solving Maxwell's equations, particularly in computational electromagnetics and photonics. It enables accurate modeling of wave propagation in complex media and structures but comes with significant computational challenges. Traditional FDTD implementations rely on handwritten, platform-specific code that optimizes certain kernels while underperforming in others. The lack of portability increases development overhead and creates performance bottlenecks, limiting scalability across modern hardware architectures. To address these challenges, we introduce an end-to-end domain-specific compiler based on the MLIR/LLVM infrastructure for FDTD simulations. Our approach generates efficient and portable code optimized for diverse hardware platforms.We implement the three-dimensional FDTD kernel as operations on a 3D tensor abstraction with explicit computational semantics. High-level optimizations such as loop tiling, fusion, and vectorization are automatically applied by the compiler. We evaluate our customized code generation pipeline on Intel, AMD, and ARM platforms, achieving up to $10\times$ speedup over baseline Python implementation using NumPy.
Facebook & Google's LazyTensor Enables Expressive Domain-Specific Compilers
Facebook and Google researchers have united to introduce a novel technique that combines eager execution and domain-specific compilers (DSCs) to exploit the benefits of both. The proposed "LazyTensor" enables the full use of all host programming language features throughout the Tensor portion of users' programs. Eager execution is an imperative, define-by-run interface that is both expressive and easy to debug and forms the basis for most widely-adopted programming languages. Optimizing DSCs, meanwhile, is a proven way to improve the performance of machine learning (ML) models, but suffers from a "language subset problem" that makes it less expressive. The two are made to work together in the new paper LazyTensor: Combining Eager Execution with Domain-Specific Compilers.